package com.relax.mybatis.encrypt.strategy;

import com.relax.mybatis.constant.Algorithm;

/**
 * @author relax
 * @date 2022/07/05
 * @desc 加密策略
 */
public interface EncryptStrategy {

    /**
     * 加密
     * 
     * @param algorithm
     * @param password
     * @param publicKey
     * @param data
     * @return
     * @throws Exception
     */
    String encrypt(Algorithm algorithm, String password, String publicKey, String data) throws Exception;

    /**
     * 解密
     * 
     * @param algorithm
     * @param password
     * @param privateKey
     * @param data
     * @return
     * @throws Exception
     */
    String decrypt(Algorithm algorithm, String password, String privateKey, String data) throws Exception;

}
